//////////////////////////////////////////////////////////////////////
// Rendering Interface class
// - Defines all the functionality to be rendered in the main loop
//
//
//////////////////////////////////////////////////////////////////////

#pragma once
#include "..\Gears\CdiObject.h"
#include <d3d9.h>

class CdiRenderBase :
  public CdiObject
{

protected:
  LPDIRECT3DDEVICE9 m_pDevice;
  BOOL              m_bHandleInput;

public:
  // Constructors
  ////////////////////////////////////////////
  CdiRenderBase( LPDIRECT3DDEVICE9 pDevice );
  
  // Deconstructors
  ////////////////////////////////////////////
  virtual ~CdiRenderBase();

public:
  // Methods
  ////////////////////////////////////////////

  // Render
  ////////////////////////////////////////////
  virtual HRESULT Render( LPDIRECT3DDEVICE9 pDevice ) = 0;

  // Can Render
  ////////////////////////////////////////////
  virtual BOOL CanRender() const = 0;

  // Set the render state
  virtual BOOL SetRender( BOOL renderState ) = 0;

  // Handle any input if necassary
  virtual void HandleInput( UINT msg, WPARAM wParam, LPARAM lParam ) { }

  // Assert this object is valid
  virtual void AssertValid();
  
  virtual void DoWork();

};
